#include <stdio.h>
#include <string.h>
#include <stdlib.h>

    const int value[4] = {25, 10, 5, 1};
    int Ncoin[4];
    int used[4];
    int f[4][100];
    int pre[4][100];
    int c;

main()
{
    int i, j, k, v, count;
    
    //freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);
    
    while (scanf("%d%d%d%d%d", Ncoin, Ncoin+1, Ncoin+2, Ncoin+3, &c), 
           Ncoin[0] || Ncoin[1] || Ncoin[2] || Ncoin[3] || c)
    {
        memset(f, -1, sizeof(f));
        for (i=0, v=0; i<=Ncoin[0] && v<=c; i++, v+=value[0]) 
			f[0][v] = i;
        for (i=0; i<3; i++)
            for (j=0; j<=c; j++) if (f[i][j] >= 0)
            {
                v = j; count = 0;
                while (v<=c && count<=Ncoin[i+1])
                {
                    if (f[i+1][v] == -1 || f[i+1][v] > f[i][j] + count)
                    {
                        f[i+1][v] = f[i][j] + count;
                        pre[i+1][v] = j;
                    }
                    v += value[i+1];
                    count++;
                }    
            }
        if (f[3][c] < 0)
            printf("Cannot dispense the desired amount.\n");
        else
        {
            for (i=3, k=c; i>0; i--)
            {
                used[i] = (k - pre[i][k])/value[i];
                k = pre [i][k];
            }
            used[0] = k/25;
            printf("Dispense %d quarters, %d dimes, %d nickels, and %d pennies.\n", used[0], used[1], used[2], used[3]);
        }    
    }    
    return 0;       
}


